package com.telchina.getui.config;

import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @Auther: zlm
 * @Date: 2023/5/31
 * @Description: com.telchina.getuitest.getui
 * @Version: 1.0
 */
public class GeTuiConditional implements Condition {
    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        String enable = conditionContext.getEnvironment().getProperty("getui.enable");
        return !StringUtils.isEmpty(enable) && Boolean.parseBoolean(enable);
    }
}
